<!--
 * @Author: ckk
 * @Date: 2022-08-15 18:23:46
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-08-22 08:58:02
 * @Description: 左右版式
-->
<template>
  <div class="right-layout">
    <div
      class="four-static"
      v-for="(item, index) in datas.imageList"
      :key="index"
      @click="goOhter(item)"
      :style="{ borderRadius: datas.borderRadius + 'px', marginBottom: datas.pageMargin + 'px' }">
      <div class="static-pic">
        <img style="height: 105px;" :style="{ borderRadius: datas.imageRadius + 'px' }" :src="item.src" alt="" />
        <div class="study-pic-jb" v-show="item.vipPosition === 1">
          <div class="jiaobiao" v-show="item.isVipShow === 1">
            <img v-show="item.vipObj.isVipShow" src="../../../assets/images/jbvip.png" alt="" />
          </div>
          <img class="jiaobiao1" v-show="item.vipObj.isProductShow" src="../../../assets/images/jbbuy.png" alt="" />
          <img class="jiaobiao1" v-show="item.vipObj.isExperienceShow" src="../../../assets/images/jbtiyan.png" alt="" />
        </div>
        <span>共{{ item.courseNum || 0 }}节</span>
      </div>
      <div class="static-content">
        <div class="static-title">
          <p class="title-name" :style="{ fontWeight: datas.textWeight }">{{ item.text }}</p>
          <p class="title-desc">{{ item.desc }}</p>
        </div>
        <div class="static-paly-num">
          <div class="static-paly-left">
            <img src="../../../assets/images/newPlay.png" alt="" />
            <span>{{ item.viewCount }}人已学</span>
          </div>
          <div class="static-paly-right" v-show="item.vipPosition === 2">
            <img v-show="item.vipObj.isVipShow" src="../../../assets/images/VIPicon.png" alt="" />
            <img v-show="item.vipObj.isProductShow" src="../../../assets/images/BUYicon.png" alt="" />
            <img v-show="item.vipObj.isExperienceShow" src="../../../assets/images/TIYANicon.png" alt="" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: '',
  props: {
    datas: Object
  },
  data () {
    return {};
  },
  methods: {
    goOhter (item) {
      this.$emit('goDetail', item);
    }
  }
};
</script>

<style scoped lang="scss">
.right-layout{
  padding:0 16px;
}
.four-static {
  display: flex;
  padding: 10px;
  background: #fff;
  .static-pic{
    position: relative;
    border-radius: 8px;
    img {
      width: 100px;
      height: 100px;
      display: block;
    }
    .study-pic-jb{
      .jiaobiao{
        width: 24px;
        height: 18px;
        position: absolute;
        top: 0px;
        right: 0;
        border-radius: 0px;
        img{
          width: 100%;
          height: 100%;
        }
      }
      .jiaobiao1{
        width: 30px;
        height: 18px;
        position: absolute;
        top: 0;
        right: 0;
      }
    }
    span{
      background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 100%);
      color: #ffffff;
      display: block;
      font-size: 12px;
      position: absolute;
      bottom: 0;
      left: 0;
      width: 90px;
      padding: 10px 0 5px 10px;
      border-bottom-right-radius: 8px;
      border-bottom-left-radius: 8px;
    }
  }
}
.static-content {
  margin-left: 12px;
  display: flex;
  padding:4px 0;
  flex-direction: column;
  justify-content: space-between;
  p {
    font-size: 16px;
    font-weight: bold;
    color: #333;
  }
  .title-name{
    overflow: hidden;
    line-height: normal;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }
  .title-desc {
    font-size: 14px;
    padding-top: 8px;
    font-weight: 400;
    color: #666;
    line-height: 21px;
    width:100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .static-paly-num {
    display: flex;
    align-items: center;
    justify-content: space-between;
    .static-paly-left{
      display: flex;
      align-items: center;
      img {
        width: 14px;
        height: 14px;
        margin-right: 4px;
      }
      span {
        font-size: 12px;
        font-family: PingFang SC-Regular, PingFang SC, sans-serif;
        font-weight: 400;
        color: #666666;
      }
    }
    .static-paly-right{
      width: 46px;
      img{
        width: 100%;
        height: 100%;
        display: block;
      }
    }
  }
}
</style>
